home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
mail.altrad.com
/
2015.02.mail.altrad.com.tar
/
mail.altrad.com
/
TEST
/
office deutch
/
INFOPATH.NL-NL
/
INFLR.CAB
/
TRAVELRE.XSN_1043
/
upgrade.xsl
< prev
next >
Wrap
Extensible Markup Language
|
2006-11-12
|
7KB
|
199 lines
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-10-21T21:12:27" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" version="1.0">
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:template match="text() | *[namespace-uri()='http://www.w3.org/1999/xhtml']" mode="RichText">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="/">
<xsl:copy-of select="processing-instruction() | comment()"/>
<xsl:choose>
<xsl:when test="my:travelRequest">
<xsl:apply-templates select="my:travelRequest" mode="_0"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="var">
<xsl:element name="my:travelRequest"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($var)/*" mode="_0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="my:roundTrip" mode="_3">
<xsl:copy>
<xsl:element name="my:returnDate">
<xsl:choose>
<xsl:when test="my:returnDate/text()[1]">
<xsl:copy-of select="my:returnDate/text()[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xsi:nil">true</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="my:returnTime">
<xsl:choose>
<xsl:when test="my:returnTime">
<xsl:copy-of select="my:returnTime/text()[1]"/>
</xsl:when>
<xsl:otherwise>Anytime</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:copy>
</xsl:template>
<xsl:template match="my:trip" mode="_2">
<xsl:copy>
<xsl:element name="my:departureLocation">
<xsl:copy-of select="my:departureLocation/text()[1]"/>
</xsl:element>
<xsl:element name="my:destination">
<xsl:copy-of select="my:destination/text()[1]"/>
</xsl:element>
<xsl:element name="my:departureDate">
<xsl:choose>
<xsl:when test="my:departureDate/text()[1]">
<xsl:copy-of select="my:departureDate/text()[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xsi:nil">true</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="my:departureTime">
<xsl:choose>
<xsl:when test="my:departureTime">
<xsl:copy-of select="my:departureTime/text()[1]"/>
</xsl:when>
<xsl:otherwise>Anytime</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="my:isRoundTrip">
<xsl:choose>
<xsl:when test="my:isRoundTrip/text()[1]">
<xsl:copy-of select="my:isRoundTrip/text()[1]"/>
</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:choose>
<xsl:when test="my:roundTrip">
<xsl:apply-templates select="my:roundTrip[1]" mode="_3"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="var">
<xsl:element name="my:roundTrip"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($var)/*" mode="_3"/>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="my:includeHotel">
<xsl:choose>
<xsl:when test="my:includeHotel/text()[1]">
<xsl:copy-of select="my:includeHotel/text()[1]"/>
</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="my:includeCar">
<xsl:choose>
<xsl:when test="my:includeCar/text()[1]">
<xsl:copy-of select="my:includeCar/text()[1]"/>
</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:copy>
</xsl:template>
<xsl:template match="my:trips" mode="_1">
<xsl:copy>
<xsl:choose>
<xsl:when test="my:trip">
<xsl:apply-templates select="my:trip" mode="_2"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="var">
<xsl:element name="my:trip"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($var)/*" mode="_2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:template>
<xsl:template match="my:preferences" mode="_4">
<xsl:copy>
<xsl:element name="my:tripClass">
<xsl:copy-of select="my:tripClass/text()[1]"/>
</xsl:element>
<xsl:element name="my:seatLocation">
<xsl:copy-of select="my:seatLocation/text()[1]"/>
</xsl:element>
<xsl:element name="my:carClass">
<xsl:copy-of select="my:carClass/text()[1]"/>
</xsl:element>
<xsl:element name="my:nonSmokingRoom">
<xsl:choose>
<xsl:when test="my:nonSmokingRoom/text()[1]">
<xsl:copy-of select="my:nonSmokingRoom/text()[1]"/>
</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:copy>
</xsl:template>
<xsl:template match="my:travelRequest" mode="_0">
<xsl:copy>
<xsl:element name="my:purpose">
<xsl:copy-of select="my:purpose/text()[1]"/>
</xsl:element>
<xsl:element name="my:requestDate">
<xsl:choose>
<xsl:when test="my:requestDate/text()[1]">
<xsl:copy-of select="my:requestDate/text()[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xsi:nil">true</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="my:name">
<xsl:copy-of select="my:name/text()[1]"/>
</xsl:element>
<xsl:element name="my:email">
<xsl:copy-of select="my:email/text()[1]"/>
</xsl:element>
<xsl:choose>
<xsl:when test="my:trips">
<xsl:apply-templates select="my:trips[1]" mode="_1"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="var">
<xsl:element name="my:trips"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($var)/*" mode="_1"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="my:preferences">
<xsl:apply-templates select="my:preferences[1]" mode="_4"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="var">
<xsl:element name="my:preferences"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($var)/*" mode="_4"/>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="my:notes">
<xsl:apply-templates select="my:notes/text() | my:notes/*[namespace-uri()='http://www.w3.org/1999/xhtml']" mode="RichText"/>
</xsl:element>
<xsl:element name="my:filterDepartureLocation">
<xsl:copy-of select="my:filterDepartureLocation/text()[1]"/>
</xsl:element>
<xsl:element name="my:filterDestination">
<xsl:copy-of select="my:filterDestination/text()[1]"/>
</xsl:element>
<xsl:element name="my:filterDepartureDate">
<xsl:copy-of select="my:filterDepartureDate/text()[1]"/>
</xsl:element>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>